package com.example.demo.controller;

import com.example.demo.pojo.Career;
import com.example.demo.pojo.Result;
import com.example.demo.service.CareerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CareerController {
    @Autowired
    CareerService careerservice;

    @GetMapping("/career/show_career")
    public Result showCareer(){
        List<Career> careers = careerservice.show_career();
        if (careers != null){
            return Result.success(careers);
        }else{
            return Result.error("展示行业分布失败");
        }
    }
}
